﻿using AutoMapper;
using LeEdu.DTO;
using LeEdu.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LeEdu.Service
{
    /// <summary>
    /// 公共服务
    /// </summary>
    public class CommonService
    {
        /// <summary>
        /// 用户信息Session主键
        /// </summary>
        public static string UserSessionName = "UserSessionName";
        /// <summary>
        /// 医院Session主键
        /// </summary>
        public static string HospitalSessionName = "HospitalSessionName";
        /// <summary>
        /// 管理员Session主键
        /// </summary>
        public static string AdminSessionName = "AdminSessionName";


        /// <summary>
        /// 注册映射管理
        /// </summary>
        public static void RegisterMap()
        {
            Mapper.Initialize(cnf => {
                cnf.CreateMap<UserInfo,UserInfoDTO>();
                cnf.CreateMap<UserInfoDTO,UserInfo>();
                cnf.CreateMap<Entity.Course,DTO.Course>();
                cnf.CreateMap<DTO.Course,Entity.Course>();
            });
        }
    }
}
